function [AvgKthDist] = Ddavid_get_average_Kth_distance(SortedDistTable, K)

AvgKthDist = sum(SortedDistTable(:, K)) / size(SortedDistTable, 1);
